package com.example.leepong.Stage;

import com.example.leepong.Game.Entities.PlayerProfile;
import com.example.leepong.Game.Presets.PlayerProfileStore;
import com.example.leepong.Game.Stage.AIPlayerConfiguration;
import com.example.leepong.R;

import java.util.ArrayList;

/**
 * Created by Ichigo on 25/05/2014.
 */
public class PlayerProvider {
    private static PlayerProvider instance = new PlayerProvider();

    public static PlayerProvider getInstance() {
        return instance;
    }

    private PlayerProvider() {

    }

    public ArrayList<AIPlayerConfiguration> getAvailableAiPlayers() {

        ArrayList<AIPlayerConfiguration> list = new ArrayList<>();
        list.add(getPlayerAIConfiguration(PlayerProfileStore.FEDERER, R.drawable.federer));
        list.add(getPlayerAIConfiguration(PlayerProfileStore.NADAL, R.drawable.nadal));
        list.add(getPlayerAIConfiguration(PlayerProfileStore.DJOCKOVIC, R.drawable.djokovic));

        return list;
    }

    private AIPlayerConfiguration getPlayerAIConfiguration(int playerid, int logoId) {
        PlayerProfile profile = PlayerProfileStore.GetProfile(playerid);

        AIPlayerConfiguration playerConfig = new AIPlayerConfiguration();
        playerConfig.logo = logoId;
        playerConfig.profile = profile;
        return playerConfig;
    }
}
